//
// Created by ✎﹏ℳ๓独赏 ☆独醉 on 2023/4/18.
//
#include <stdio.h>
void getdata(int a[],int n){
    int i;
    for(i=0;i<n;i++){
        a[i]=i;
    }
}
int search(int a[],int n,int x){
    int left=0,right=n-1,mid;
    while(left<=right){
        mid=(left+right)/2;
        if(x>a[mid])left=mid+1;
        else if(x<a[mid])right=mid-1;
        else return mid;
    }
    if(left>right)return -1;
}
int main(){
    int arr[100],n,x;
    scanf("%d%d",&n,&x);
    getdata(arr,n);
    printf("%d", search(arr,n,x));
    return 0;
}